/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.services.security;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import src.domain.security.Users;
import src.services.CRUEDService;

/**
 *
 * @author Yusup Jauhari Shandi <chan at In.Visi Forever!>
 */
public class UsersModel implements Serializable{
    private CRUEDService service;

    public UsersModel() {
        service = new CRUEDService();
    }
    
    
    public List<Users> findAll(Map<String, String> filters) {
        return (List<Users>) service.findAll("Users",filters);
    }

    public boolean saveData(Users data) {
        return service.saveData(data);
    }
    
    public boolean deleteData(Users data) {
        return service.deleteData(data);
    }
    
     public Users login(Map<String, String> filters) {
        return (Users)  service.getObjectSQL("from Users",filters);
    }
     
     public Users getById(Integer id){
          return (Users)  service.getById(Users.class, id);
     }

}
